import Header from "./components/Header";
import routes from "./routes";
import { useRoutes } from "react-router-dom";
import { Suspense } from "react";
// suspense显示东西没加载时，切换内容
function App() {
  let element = useRoutes(routes);
  return (
    <>
      <Header />
      <Suspense fallback={<h1>Loading...</h1>}>{element}</Suspense>
    </>
  );
}

export default App;
